$(function () {
    // 配置路径
    var pageUrl = config.urlAnaConfig.testPath;
    // 获取Cookie
    function getCookie(name){
        var strcookie = document.cookie;//获取cookie字符串
        var arrcookie = strcookie.split("; ");//分割
    //       console.log(arrcookie);
        //遍历匹配
        for ( var i = 0; i < arrcookie.length; i++) {
            var arr = arrcookie[i].split("=");
                if (arr[0] ==name){
                    return arr[1];
                }
        }
        return "";
    }
    var name = "tokenval";
    // tiken值
    var cookie_value = getCookie(name);
    console.log(cookie_value);
    var name1 = "userName";
    // 用户名值
    var cookie_value1 = getCookie(name1);
    $(".userName").html(cookie_value1);
    $(".nav-usename").html(cookie_value1);

// 时间选择
    VariousFun.VariousTime();
    // 渠道数据
    $.ajax({
        url: pageUrl+'/api/summary/getchannelandstore',
        type: 'POST',
        dataType: 'json',
        headers: {
            Authorization: 'Bearer '+cookie_value
        },
        success: function (data) {
            var msg = '';
            if (data) {
                if (data.code === 200) {
//                  店铺名称
//                  店铺名称1
                    var storeName = data.data.storeNameCn;
                    console.log(storeName+"1111111111111")
                    var storeNameF = $(".storeName").next("ul");
                    /*for in 循环*/
                     for(var i in storeName){
                     var text="<li>"+storeName[i]+"</li>";
                     storeNameF.append(text)
                     };
//                  店铺名称2
                    var platForm = data.data.platform;
                    console.log(platForm)
                    var platFormF = $(".platForm").next("ul");
                    /*for in 循环*/
                    for(var i in platForm){
                    var text="<li>"+platForm[i]+"</li>";
                    platFormF.append(text)
                    };
                }
            }
        },
        error:  function (XMLHttpRequest, textStatus, errorThrown) {
                    // msg
                    var errorTips = XMLHttpRequest.responseJSON.msg;
                    if (errorTips=='Division by zero'){
                        $(".layer1 .content").html("渠道数据数据错误");
                        $(".layer1").show();
                        console.log(errorTips);
                    } else if(errorTips=='Token has expired'){
                        $(".layer1 .content").html("令牌过期").show();
                        $(".layer1").show();
                        window.location.href="login.html";
                    }


                }

    });

    // 默认时间参数
    var startDate = $(".tjTimeS").html();
    var endDate = $(".tjTimeE").html();
    var storeNameCn = '';
    var platformM = '';
    //    生意主要指标
    function syzyzb() {
        $.ajax({
        url: pageUrl+'/api/summary/gmvanduv',
        type: 'POST',
        dataType: 'json',
        data: {
            'startDate': startDate,
            'endDate': endDate,
            'storeNameCn': storeNameCn,
            'platform': platformM
        },
        headers: {
            Authorization: 'Bearer '+cookie_value
        },
        success: function (data) {
            var msg = '';
            if (data) {
                if (data.code === 200) {
//                    生意主要指标数字
                    var gmvData = data.data.gmv.gmv;
                    var gmvDataL = data.data.gmv.lastYearGmv;
                    $(".main1-con-tab1 .gmvData").html(gmvData);
                    $(".main1-con-tab1 .gmvDataL").html(gmvDataL);
                    var uvData = data.data.uv.uv;
                    var uvDataL = data.data.uv.lastYearUv;
                    $(".main1-con-tab2 .gmvData").html(uvData);
                    $(".main1-con-tab2 .gmvDataL").html(uvDataL);
//                    生意主要指标icon
                    $("#jt004").removeClass();
                    if (data.data.gmv.gmvTrend==1){
                        $("#jt004").addClass("jt-top");
                    } else if(data.data.gmv.gmvTrend==2) {
                        $("#jt004").addClass("jt-down");
                    } else if(data.data.gmv.gmvTrend==0) {
                        $("#jt004").addClass("jt-top");
                    };
                    $("#jt005").removeClass();
                    if (data.data.uv.uvTrend==1){
                        $("#jt005").addClass("jt-top");
                    } else if(data.data.uv.uvTrend==2) {
                        $("#jt005").addClass("jt-down");
                    } else if(data.data.uv.uvTrend==0) {
                        $("#jt005").addClass("jt-top");
                    };
                }
            }
        },
        error:  function (XMLHttpRequest, textStatus, errorThrown) {
                    // msg
                    var errorTips = XMLHttpRequest.responseJSON.msg;
                    if (errorTips=='Division by zero'){
                        $(".layer1 .content").html("生意主要指标数据错误");
                        $(".layer1").show();
                        console.log(errorTips);
                    } else if(errorTips=='Token has expired'){
                        $(".layer1 .content").html("令牌过期");
                        $(".layer1").show();
                        window.location.href="login.html";
                    }


                }

    });
    };
    syzyzb();
        // 活跃用户
    function hyyh() {
        $.ajax({
        url: pageUrl+'/api/summary/activeuserreport',
        type: 'POST',
        dataType: 'json',
        data: {
            'startDate': startDate,
            'endDate': endDate,
            'storeNameCn': storeNameCn,
            'platform': platformM
        },
        headers: {
            Authorization: 'Bearer '+cookie_value
        },
        success: function (data) {
            var msg = '';
            if (data) {
                if (data.code === 200) {
//                    用户活跃shu
                    var userAll = data.data.allUser;
                    var userActive = data.data.activeUser;
                    var userOlder = data.data.olderUser;
                    var percentActive = data.data.activePercent;
                    var percentOlderUser = data.data.olderUserPercent;
                    $(".user-nb1 p").html(userAll);
                    $(".user-nb2 p").html(userActive);
                    $(".user-nb3 p").html(userOlder);
                 /*   var Activebfb = userActive/userAll;
                    var Olderbfb = userOlder/userAll;
                     Activebfb =  Activebfb.toFixed(3);
                     Olderbfb =  Olderbfb.toFixed(3);*/
                    $(".user-nb2 div span").html(percentActive);
                    $(".user-nb3 div span").html(percentOlderUser);
                }
            }
        },
        error:  function (XMLHttpRequest, textStatus, errorThrown) {
                    // msg
                    var errorTips = XMLHttpRequest.responseJSON.msg;
                    if (errorTips=='Division by zero'){
                        $(".layer1 .content").html("数据错误");
                        $(".layer1").show();
                        console.log(errorTips);
                    } else if(errorTips=='Token has expired'){
                        $(".layer1 .content").html("令牌过期");
                        $(".layer1").show();
                        window.location.href="login.html";
                    }


                }

    });
    };
    hyyh();

    // 趋势健康指标
    function jkzb() {
        $.ajax({
        url: pageUrl+'/api/summary/gethealthindex',
        type: 'POST',
        dataType: 'json',
        data: {
            'startDate': startDate,
            'endDate': endDate,
            'storeNameCn': storeNameCn,
            'platform': platformM,
        },
        headers: {
            Authorization: 'Bearer '+cookie_value
        },
        success: function (data) {
            var msg = '';
            if (data) {
                if (data.code === 200) {
//                  客单件价
                    var keDJ = data.data.customerUnitPrice.customerUnitPrice;
                    var keDJ2 = data.data.customerUnitPrice.lastYearCustomerUnitPrice;
                    var qinshoulv = data.data.sellPercent;
                    var zheKou = data.data.offerPercent.offPercent;
                    var zheKou2 = data.data.offerPercent.lastYearOffPercent;
                    $(".module-04 .xuanxiang1 .kdjiaData0").html(keDJ);
                    $(".module-04 .xuanxiang1 .kdjiaData1").html(keDJ2);
                    $(".module-04 .xuanxiang1 .qinshoulv").html(qinshoulv);
                    $(".module-04 .xuanxiang1 .zhekouData0").html(zheKou);
                    $(".module-04 .xuanxiang1 .zhekouData1").html(zheKou2);
                    $("#jt001").removeClass();

                    if (data.data.customerUnitPrice.trend==1){
                        $("#jt001").addClass("jt-top jiantou-icon");
                    } else if(data.data.customerUnitPrice.trend==2) {
                        $("#jt001").addClass("jt-down jiantou-icon");
                    }else if(data.data.customerUnitPrice.trend==0) {
                        $("#jt001").addClass("jt-top jiantou-icon");
                    };
                    $("#jt002").removeClass();
                   /* console.log(data.data.customerPerItems.trend);
                    if (data.data.customerPerItems.trend==1){
                        $("#jt002").addClass("jt-top jiantou-icon");
                        console.log(data.data.customerPerItems.trend+"99999999");
                    } else if(data.data.customerPerItems.trend==2) {
                        $("#jt002").addClass("jt-down jiantou-icon");
                    }else if(data.data.customerPerItems.trend==0) {
                        $("#jt002").addClass("jt-top jiantou-icon");
                    };*/
                     $("#jt003").removeClass();
                    if (data.data.offerPercent.trend==1){
                         $("#jt003").addClass("jt-top jiantou-icon");
                    } else if(data.data.offerPercent.trend==2) {
                         $("#jt003").addClass("jt-down jiantou-icon");
                    } else if(data.data.offerPercent.trend==0) {
                         $("#jt003").addClass("jt-top jiantou-icon");
                    };
                }
            }
        },
        error:  function (XMLHttpRequest, textStatus, errorThrown) {
                    // msg
                    var errorTips = XMLHttpRequest.responseJSON.msg;
                    if (errorTips=='Division by zero'){
                        $(".layer1 .content").html("趋势健康指标数据错误");
                        $(".layer1").show();
                        console.log(errorTips);
                    } else if(errorTips=='Token has expired'){
                        $(".layer1 .content").html("令牌过期");
                        $(".layer1").show();
                        window.location.href="login.html";
                    }


                }

    });
    };
    jkzb();

    // 指标简报
    function zbjb() {
        $.ajax({
        url: pageUrl+'/api/summary/getbriefreport',
        type: 'POST',
        dataType: 'json',
        data: {
            'startDate': startDate,
            'endDate': endDate,
            'storeNameCn': storeNameCn,
            'platform': platformM,
        },
        headers: {
            Authorization: 'Bearer '+cookie_value
        },
        success: function (data) {
            var msg = '';
            if (data) {
                if (data.code === 200) {
//                  客单件价
                    var baokeDJ = data.data.customerUnitPrice.customerUnitPrice;
                    var baokeDJ2 = data.data.customerUnitPrice.lastYearCustomerUnitPricePercent;
                    var baokeDJ3 = data.data.customerUnitPrice.lastCycleCustomerUnitPricePercent;
                    var baokeDanJia = data.data.customerPerItems.customerPerItems;
                    var baokeDanJia2 = data.data.customerPerItems.lastYearCustomerPerItemsPercent;
                    var baokeDanJia3 = data.data.customerPerItems.lastCycleCustomerPerItemsPercent;
                    var baozheKou = data.data.offerPercent.offPercent;
                    var baozheKou2 = data.data.offerPercent.lastYearOffPercent;
                    var baozheKou3 = data.data.offerPercent.lastCycleOffPercent;
                    console.log(baokeDJ+"---"+baokeDJ2+"---"+baokeDJ3+"---"+baokeDanJia+"---"+baokeDanJia2+"---"+baokeDanJia3+"---"+baozheKou+"---"+baozheKou2+"---"+baozheKou3)
                    $(".module-05 .zbjb11").html(baokeDJ);
               /*     $(".module-05 .zbjb13").html(baokeDJ2);
                    $(".module-05 .zbjb15").html(baokeDJ3);*/
                    $(".module-05 .zbjb21").html(baokeDanJia);
                  /*  $(".module-05 .zbjb23").html(baokeDanJia2);
                    $(".module-05 .zbjb25").html(baokeDanJia3);*/
                    $(".module-05 .zbjb31").html(baozheKou);
                  /*  $(".module-05 .zbjb33").html(baozheKou2);
                    $(".module-05 .zbjb35").html(baozheKou3);*/
                    /*if (baokeDJ2<0){
                        $(".module-05 .zbjb12").html("下跌");
                    }else {
                        $(".module-05 .zbjb12").html("上涨");
                    };
                    if (baokeDJ2<0){
                        $(".module-05 .zbjb14").html("下跌");
                    }else {
                        $(".module-05 .zbjb14").html("上涨");
                    };
                    if (baokeDJ2<0){
                        $(".module-05 .zbjb22").html("下跌");
                    }else {
                        $(".module-05 .zbjb22").html("上涨");
                    };
                    if (baokeDJ2<0){
                        $(".module-05 .zbjb24").html("下跌");
                    }else {
                        $(".module-05 .zbjb24").html("上涨");
                    };
                    if (baokeDJ2<0){
                        $(".module-05 .zbjb32").html("下跌");
                    }else {
                        $(".module-05 .zbjb32").html("上涨");
                    };
                    if (baokeDJ2<0){
                        $(".module-05 .zbjb34").html("下跌");
                    }else {
                        $(".module-05 .zbjb34").html("上涨");
                    };*/
                }
            }
        },
        error:  function (XMLHttpRequest, textStatus, errorThrown) {
                    // msg
                    var errorTips = XMLHttpRequest.responseJSON.msg;
                    if (errorTips=='Division by zero'){
                        $(".layer1 .content").html("指标简报数据错误");
                        $(".layer1").show();
                        console.log(errorTips);
                    } else if(errorTips=='Token has expired'){
                        $(".layer1 .content").html("令牌过期");
                        $(".layer1").show();
                        window.location.href="login.html";
                    }


                }

    });
    };
    zbjb();
    // 生意漏斗
    function syld() {
        $.ajax({
        url: pageUrl+'/api/summary/getbusinessfunnel',
        type: 'POST',
        dataType: 'json',
        data: {
            'startDate': startDate,
            'endDate': endDate,
            'storeNameCn': storeNameCn,
            'platform': platformM,
        },
        headers: {
            Authorization: 'Bearer '+cookie_value
        },
        success: function (data) {
            var msg = '';
            if (data) {
                if (data.code === 200) {
//                  客单件价
                    var syld1 = data.data.businessFunnel.payRefund;
                    var syld2 = data.data.businessFunnel.deliveryRefund;
                    var syld3 = data.data.businessFunnel.gmv;
                    var syld4 = data.data.businessFunnel.deliveryAmount;
                    var syld5 = data.data.businessFunnel.deliveryPercent;
                    var syld6 = data.data.businessFunnel.deliveryPercent;
                    var syld7 = data.data.businessFunnel.inAccountAmountPercent;
                    var syld8 = data.data.businessFunnel.payAmount;
                    var syld9 = data.data.businessFunnel.payCusts;
                    var syld10 = data.data.businessFunnel.inAccountAmount;
                    var syld11 = data.data.businessFunnel.lastModifyDate;
                    var syld12 = data.data.businessFunnel.payPercent;
                    $(".yld-data .sy1").html(syld1);
                    $(".yld-data .sy2").html(syld2);
                    $(".yld-data .sy3").html(syld3);
                    $(".yld-data .sy4").html(syld8);
                    $(".yld-data .sy5").html(syld9);
                    $(".yld-data .sy6").html(syld4);
                    $(".yld-data .sy7").html(syld10);
                    $(".yld-data .sy8").html(syld11);
                    $(".yld-data .sy11").html(syld7+"%");
                    $(".yld-data .sy12").html(syld6+"%");
                    $(".yld-data .sy13").html(syld12+"%");
                }
            }
        },
        error:  function (XMLHttpRequest, textStatus, errorThrown) {
                    // msg
                    var errorTips = XMLHttpRequest.responseJSON.msg;
                    if (errorTips=='Division by zero'){
                        $(".layer1 .content").html("生意漏斗数据错误");
                        $(".layer1").show();
                        console.log(errorTips);
                    } else if(errorTips=='Token has expired'){
                        $(".layer1 .content").html("令牌过期");
                        $(".layer1").show();
                        window.location.href="login.html";
                    }


                }

    });
    };
    syld();
    // 目标数据
    function shuju() {
        $.ajax({
        url: pageUrl+'/api/summary/getgoaldata',
        type: 'POST',
        dataType: 'json',
        headers: {
            Authorization: 'Bearer '+cookie_value
        },
        success: function (data) {
            var msg = '';
            if (data) {
                if (data.code === 200) {
                    var mubiaoVal = data.data;
                    var mubiaoValF = $(".module-02 .module-02-data");
                    /*for in 循环*/
                    for(var i in mubiaoVal){
                        var text="<li>" + "<p>" + i + " </p>"+"<span>" + mubiaoVal[i] + " </span>" + "</li>";
                        mubiaoValF.append(text);
                    };
                }
            }
        },
        error:  function (XMLHttpRequest, textStatus, errorThrown) {
                    // msg
                    var errorTips = XMLHttpRequest.responseJSON.msg;
                    if (errorTips=='Division by zero'){
                        $(".layer1 .content").html("目标数据数据错误");
                        $(".layer1").show();
                        console.log(errorTips);
                    } else if(errorTips=='Token has expired'){
                        $(".layer1 .content").html("令牌过期");
                        $(".layer1").show();
                        window.location.href="login.html";
                    }


                }

    });
    };
    shuju();




    // 图表
    $.ajax({
        url: pageUrl+'/api/common/getaccesstoken',
        type: 'POST',
        dataType: 'json',
        success: function (data) {
            var msg = '';
            if (data) {
                var accessToken = data.data.accessToken.value;
                console.log(accessToken);
                var myUrl = "https://app.powerbi.cn/reportEmbed?reportId=a2595750-89e6-4989-8d9b-425750124ed7&groupId=13e42e94-3404-46d8-b605-228c35984df3&filter=date_table/data_date ge 2019-04-07 and date_table/data_date le 2019-04-13";
                var myUrl2 = "https://app.powerbi.cn/reportEmbed?reportId=a2595750-89e6-4989-8d9b-425750124ed7&groupId=13e42e94-3404-46d8-b605-228c35984df3&filter=date_table/data_date ge 2019-04-07 and date_table/data_date le 2019-04-13 and platform_table/platform eq 'all' and shop_table/shop eq 'all'";
                 GMV(accessToken,myUrl);
                 UV(accessToken,myUrl);
                 MUB(accessToken,myUrl);
                 KDJian(accessToken,myUrl);
                 QSL(accessToken,myUrl2);
                 ZheKou(accessToken,myUrl);
                 fangkeshu(accessToken);
                 zhifujine(accessToken);
            }
        },
        error:  function (XMLHttpRequest, textStatus, errorThrown) {
                    // msg
                    var errorTips = XMLHttpRequest.responseJSON.msg;
                    if (errorTips=='Division by zero'){
                        $(".layer1 .content").html("数据错误");
                        $(".layer1").show();
                        console.log(errorTips);
                    } else if(errorTips=='Token has expired'){
                        $(".layer1 .content").html("令牌过期");
                        $(".layer1").show();
                        window.location.href="login.html";
                    }


                }

    });

    // GMV表
    function GMV(accessToken,myUrl) {
            accessToken = accessToken;
            embedUrl = myUrl;
            console.log(embedUrl);
            var embedReportId = "a2595750-89e6-4989-8d9b-425750124ed7";
            var embedpageName = "ReportSection96e0ac85e03e998efc83";
            var embedvisualName = "c5d2e21ad21dcb0b2efb";
            var models = window['powerbi-client'].models;
            var config = {
                type: 'visual',
                // tokenType: models.TokenType.Embed,
                accessToken: accessToken,
                embedUrl: embedUrl,
                id: embedReportId,
                pageName: embedpageName,
                visualName: embedvisualName,
                // filters: filter
            };
            var tu11 = $('.tu11')[0];
            var report = powerbi.embed(tu11, config);
            report.getFilters(models.FiltersLevel.Report)
            .then(function (filters) {
                consolo.log(filters);
            })
            .catch(function (errors) {
                consolo.log(errors);
            });
     };
    // UV表
    function UV(accessToken,myUrl) {
        accessToken = accessToken;
        embedUrl = myUrl;
        var embedReportId = "a2595750-89e6-4989-8d9b-425750124ed7";
        var embedpageName = "ReportSection96e0ac85e03e998efc83";
        var embedvisualName = "44f8ef96ea5a4c9e6ba3";
        var models = window['powerbi-client'].models;
        var config = {
            type: 'visual',
            // tokenType: models.TokenType.Embed,
            accessToken: accessToken,
            embedUrl: embedUrl,
            id: embedReportId,
            pageName: embedpageName,
            visualName: embedvisualName,
            // filters: filter
        };
        var tu22 = $('.tu22')[0];
        var report = powerbi.embed(tu22, config);
        report.getFilters(models.FiltersLevel.Report)
        .then(function (filters) {
            consolo.log(filters);
        })
        .catch(function (errors) {
            consolo.log(errors);
        });
    };
    // 目标表
    function MUB(accessToken,myUrl) {
                        accessToken = accessToken;
                        embedUrl = myUrl;
                        var embedReportId = "a2595750-89e6-4989-8d9b-425750124ed7";
                        var embedpageName = "ReportSection96e0ac85e03e998efc83";
                        var embedvisualName = "f682a8fb009a6f439e39";
                        var models = window['powerbi-client'].models;
                        var config = {
                            type: 'visual',
                            // tokenType: models.TokenType.Embed,
                            accessToken: accessToken,
                            embedUrl: embedUrl,
                            id: embedReportId,
                            pageName: embedpageName,
                            visualName: embedvisualName,
                            // filters: filter
                        };
                        var tu33 = $('.tu33')[0];
                        var report = powerbi.embed(tu33, config);
                        report.getFilters(models.FiltersLevel.Report)
                        .then(function (filters) {
                            consolo.log(filters);
                        })
                        .catch(function (errors) {
                            consolo.log(errors);
                        });
                    };
    // 客单价
    function KDJian(accessToken,myUrl) {
        accessToken = accessToken;
        embedUrl = myUrl;
        // Read report Id from Model
        var embedReportId = "a2595750-89e6-4989-8d9b-425750124ed7";
        var embedpageName = "ReportSection96e0ac85e03e998efc83";
        var embedvisualName = "f0caabdc16b2e79e787b";
        var models = window['powerbi-client'].models;
        var config = {
            type: 'visual',
            // tokenType: models.TokenType.Embed,
            accessToken: accessToken,
            embedUrl: embedUrl,
            id: embedReportId,
            pageName: embedpageName,
            visualName: embedvisualName,
            // filters: filter
        };
        var tu44 = $('.tu44')[0];
        var report = powerbi.embed(tu44, config);
        report.getFilters(models.FiltersLevel.Report)
        .then(function (filters) {
            consolo.log(filters);
        })
        .catch(function (errors) {
            consolo.log(errors);
        });
    };
    // 客单件
    function QSL(accessToken,myUrl2) {
        accessToken = accessToken;
        embedUrl = myUrl2;
        // Read report Id from Model
        var embedReportId = "a2595750-89e6-4989-8d9b-425750124ed7";
        var embedpageName = "ReportSection96e0ac85e03e998efc83";
        var embedvisualName = "e8d0d3045fbd147dfc1d";
         // var embedvisualName = "e8d0d3045fbd147dfc1d";
        // Get models. models contains enums that can be used.
        var models = window['powerbi-client'].models;
        // Embed configuration used to describe the what and how to embed.
        // This object is used when calling powerbi.embed.
        // This also includes settings and options such as filters.
        // You can find more information at https://github.com/Microsoft/PowerBI-JavaScript/wiki/Embed-Configuration-Details.
        var config = {
            type: 'visual',
            // tokenType: models.TokenType.Embed,
            accessToken: accessToken,
            embedUrl: embedUrl,
            id: embedReportId,
            pageName: embedpageName,
            visualName: embedvisualName,
            // filters: filter
        };
        // Get a reference to the embedded report HTML element
        var tu55 = $('.tu55')[0];
        var report = powerbi.embed(tu55, config);
        report.getFilters(models.FiltersLevel.Report)
        .then(function (filters) {
            consolo.log(filters);
        })
        .catch(function (errors) {
            consolo.log(errors);
        });
    };
    // 折扣
    function ZheKou(accessToken,myUrl) {
        accessToken = accessToken;
        // embedUrl = myUrl;
        var embedUrl = "https://app.powerbi.cn/reportEmbed?reportId=a2595750-89e6-4989-8d9b-425750124ed7&groupId=13e42e94-3404-46d8-b605-228c35984df3";
        // Read report Id from Model
        var embedReportId = "a2595750-89e6-4989-8d9b-425750124ed7";
        var embedpageName = "ReportSection96e0ac85e03e998efc83";
        var embedvisualName = "9a84c6205e21147ec944";
        var models = window['powerbi-client'].models;
        var config = {
            type: 'visual',
            // tokenType: models.TokenType.Embed,
            accessToken: accessToken,
            embedUrl: embedUrl,
            id: embedReportId,
            pageName: embedpageName,
            visualName: embedvisualName,
            // filters: filter
        };
        var tu66 = $('.tu66')[0];
        var report = powerbi.embed(tu66, config);
        report.getFilters(models.FiltersLevel.Report)
        .then(function (filters) {
            consolo.log(filters);
        })
        .catch(function (errors) {
            consolo.log(errors);
        });
    };
    // 平台访客数
    function fangkeshu(accessToken) {
        accessToken = accessToken;
        // embedUrl = myUrl;
        var embedUrl = "https://app.powerbi.cn/reportEmbed?reportId=a2595750-89e6-4989-8d9b-425750124ed7&groupId=13e42e94-3404-46d8-b605-228c35984df3";
        var embedReportId = "a2595750-89e6-4989-8d9b-425750124ed7";
        var embedpageName = "ReportSection96e0ac85e03e998efc83";
        var embedvisualName = "d1933b591fbc8646da66";
        var models = window['powerbi-client'].models;
        var config = {
            type: 'visual',
            // tokenType: models.TokenType.Embed,
            accessToken: accessToken,
            embedUrl: embedUrl,
            id: embedReportId,
            pageName: embedpageName,
            visualName: embedvisualName,
            // filters: filter
        };
        // Get a reference to the embedded report HTML element
        var tu77 = $('.tu77')[0];
        var report = powerbi.embed(tu77, config);
        report.getFilters(models.FiltersLevel.Report)
        .then(function (filters) {
            consolo.log(filters);
        })
        .catch(function (errors) {
            consolo.log(errors);
        });

    }
    // 平台支付金额
    function zhifujine(accessToken) {
        accessToken = accessToken;
        // embedUrl = myUrl;
        var embedUrl = "https://app.powerbi.cn/reportEmbed?reportId=a2595750-89e6-4989-8d9b-425750124ed7&groupId=13e42e94-3404-46d8-b605-228c35984df3";
        var embedReportId = "a2595750-89e6-4989-8d9b-425750124ed7";
        var embedpageName = "ReportSection96e0ac85e03e998efc83";
        var embedvisualName = "eb54a94fd8f75d58de55";
        var models = window['powerbi-client'].models;
        var config = {
            type: 'visual',
            // tokenType: models.TokenType.Embed,
            accessToken: accessToken,
            embedUrl: embedUrl,
            id: embedReportId,
            pageName: embedpageName,
            visualName: embedvisualName,
            // filters: filter
        };
        var tu88 = $('.tu88')[0];
        var report = powerbi.embed(tu88, config);
        report.getFilters(models.FiltersLevel.Report)
        .then(function (filters) {
            consolo.log(filters);
        })
        .catch(function (errors) {
            consolo.log(errors);
        });
    }


    // 数据重置
        var pingjieIndex1 = 0;
        var pingjieIndex2 = 0;
        var pingjieIndex3 = 0;
        var pingjieIndex4 = 0;
        var pingjieIndex5 = 0;
        var pingjieIndex6 = 0;
        var pingjieIndex7 = 0;
        var pingjieIndex8 = 0;
    function xiaohezi() {
        // 拼接图形盒子1
        pingjieIndex1++;
        var tu1Id = "reportContainer";
        tu1Id = tu1Id + pingjieIndex1;
        console.log(tu1Id);
        var arrtx1 = [];
        arrtx1.push("<div class='tu11 no-border'" + "id=" +tu1Id +">");
        arrtx1.push("</div>");
        str1 = arrtx1.join('');
        $(".tu1").append(str1);
        // 删除其他元素
        $('.tu1'+' #'+tu1Id).siblings().remove();

        // 拼接图形盒子2
        pingjieIndex2++;
        var tu2Id = "reportContainer1";
        tu2Id = tu2Id + pingjieIndex2;
        console.log(tu2Id);
        var arrtx2 = [];
        arrtx2.push("<div class='tu22 no-border'" + "id=" +tu2Id +">");
        arrtx2.push("</div>");
        str2 = arrtx2.join('');
        $(".tu2").append(str2);
        // 删除其他元素
        $('.tu2'+' #'+tu2Id).siblings().remove();

        // 拼接图形盒子3
        pingjieIndex3++;
        var tu3Id = "reportContainer12";
        tu3Id = tu3Id + pingjieIndex3;
        console.log(tu3Id);
        var arrtx3 = [];
        arrtx3.push("<div class='tu33 no-border'" + "id=" +tu3Id +">");
        arrtx3.push("</div>");
        str3 = arrtx3.join('');
        $(".tu3").append(str3);
        $('.tu3'+' #'+tu3Id).siblings().remove();
        // 拼接图形盒子4
        pingjieIndex4++;
        var tu4Id = "reportContainer3";
        tu4Id = tu4Id + pingjieIndex4;
        console.log(tu4Id);
        var arrtx4 = [];
        arrtx4.push("<div class='tu44 no-border'" + "id=" +tu4Id +">");
        arrtx4.push("</div>");
        str4 = arrtx4.join('');
        $(".tu4").append(str4);
        $('.tu4'+' #'+tu4Id).siblings().remove();
        // 拼接图形盒子5
        pingjieIndex5++;
        var tu5Id = "reportContainer4";
        tu5Id = tu5Id + pingjieIndex5;
        console.log(tu5Id);
        var arrtx5 = [];
        arrtx5.push("<div class='tu55 no-border'" + "id=" +tu5Id +">");
        arrtx5.push("</div>");
        str5 = arrtx5.join('');
        $(".tu5").append(str5);
        $('.tu5'+' #'+tu5Id).siblings().remove();
        // 拼接图形盒子6
        pingjieIndex6++;
        var tu6Id = "reportContainer5";
        tu6Id = tu6Id + pingjieIndex6;
        console.log(tu6Id);
        var arrtx6 = [];
        arrtx6.push("<div class='tu66 no-border'" + "id=" +tu6Id +">");
        arrtx6.push("</div>");
        str6 = arrtx6.join('');
        $(".tu6").append(str6);
        $('.tu6'+' #'+tu6Id).siblings().remove();
        // 拼接图形盒子7
        pingjieIndex7++;
        var tu7Id = "reportContainer7";
        tu7Id = tu7Id + pingjieIndex7;
        console.log(tu7Id);
        var arrtx7 = [];
        arrtx7.push("<div class='tu77 no-border'" + "id=" +tu7Id +">");
        arrtx7.push("</div>");
        str7 = arrtx7.join('');
        $(".tu7").append(str7);
        $('.tu7'+' #'+tu7Id).siblings().remove();
        // 拼接图形盒子8
        pingjieIndex8++;
        var tu8Id = "reportContainer8";
        tu8Id = tu8Id + pingjieIndex8;
        console.log(tu8Id);
        var arrtx8 = [];
        arrtx8.push("<div class='tu88 no-border'" + "id=" +tu8Id +">");
        arrtx8.push("</div>");
        str8 = arrtx8.join('');
        $(".tu8").append(str8);
        $('.tu8'+' #'+tu8Id).siblings().remove();
    }
    $(".application").on("click",function (e) {
        var event=e||event;
        event.preventDefault();
        // 盒子图形拼接
        xiaohezi();
        // 默认时间参数
        var startDate = $(".tjTimeS").html();
        var endDate = $(".tjTimeE").html();
        var storeName = $(".storeName").val();
        var platForm = $(".platForm").val();
        console.log(startDate);
        console.log(endDate);
        console.log(storeName);
        console.log(platForm);
        // 生意主要指标
        $.ajax({
        url: pageUrl+'/api/summary/gmvanduv',
        type: 'POST',
        dataType: 'json',
        data: {
            'startDate': startDate,
            'endDate': endDate,
            'storeNameCn': storeNameCn,
            'platform': platForm
        },
        headers: {
            Authorization: 'Bearer '+cookie_value
        },
        success: function (data) {
            var msg = '';
            if (data) {
                if (data.code === 200) {
//                    生意主要指标数字
                    var gmvData = data.data.gmv.gmv;
                    var gmvDataL = data.data.gmv.lastYearGmv;
                    $(".main1-con-tab1 .gmvData").html(gmvData);
                    $(".main1-con-tab1 .gmvDataL").html(gmvDataL);
                    var uvData = data.data.uv.uv;
                    var uvDataL = data.data.uv.lastYearUv;
                    $(".main1-con-tab2 .gmvData").html(uvData);
                    $(".main1-con-tab2 .gmvDataL").html(uvDataL);
//                    生意主要指标icon
                    $("#jt004").removeClass();
                    if (data.data.gmv.gmvTrend==1){
                        $("#jt004").addClass("jt-top");
                    } else if(data.data.gmv.gmvTrend==2) {
                        $("#jt004").addClass("jt-down");
                    } else if(data.data.gmv.gmvTrend==0) {
                        $("#jt004").addClass("jt-top");
                    };
                    $("#jt005").removeClass();
                    if (data.data.uv.uvTrend==1){
                        $("#jt005").addClass("jt-top");
                    } else if(data.data.uv.uvTrend==2) {
                        $("#jt005").addClass("jt-down");
                    } else if(data.data.uv.uvTrend==0) {
                        $("#jt005").addClass("jt-top");
                    };
                }
            }
        },
        error:  function (XMLHttpRequest, textStatus, errorThrown) {
                    // msg
                    var errorTips = XMLHttpRequest.responseJSON.msg;
                    if (errorTips=='Division by zero'){
                        $(".layer1 .content").html("生意主要指标数据错误");
                        $(".layer1").show();
                        console.log(errorTips);
                    } else if(errorTips=='Token has expired'){
                        $(".layer1 .content").html("令牌过期");
                        $(".layer1").show();
                        window.location.href="login.html";
                    }


                }

    });
        // 活跃用户
        $.ajax({
        url: pageUrl+'/api/summary/activeuserreport',
        type: 'POST',
        dataType: 'json',
        data: {
            'startDate': startDate,
            'endDate': endDate,
            'storeNameCn': storeNameCn,
            'platform': platForm
        },
        headers: {
            Authorization: 'Bearer '+cookie_value
        },
        success: function (data) {
            var msg = '';
            if (data) {
                if (data.code === 200) {
//                    用户活跃shu
                    var userAll = data.data.allUser;
                    var userActive = data.data.activeUser;
                    var userOlder = data.data.olderUser;
                    var percentActive = data.data.activePercent;
                    var percentOlderUser = data.data.olderUserPercent;
                    $(".user-nb1 p").html(userAll);
                    $(".user-nb2 p").html(userActive);
                    $(".user-nb3 p").html(userOlder);
                 /*   var Activebfb = userActive/userAll;
                    var Olderbfb = userOlder/userAll;
                     Activebfb =  Activebfb.toFixed(3);
                     Olderbfb =  Olderbfb.toFixed(3);*/
                    $(".user-nb2 div span").html(percentActive);
                    $(".user-nb3 div span").html(percentOlderUser);
                }
            }
        },
        error:  function (XMLHttpRequest, textStatus, errorThrown) {
                    // msg
                    var errorTips = XMLHttpRequest.responseJSON.msg;
                    if (errorTips=='Division by zero'){
                        $(".layer1 .content").html("数据错误");
                        $(".layer1").show();
                        console.log(errorTips);
                    } else if(errorTips=='Token has expired'){
                        $(".layer1 .content").html("令牌过期");
                        $(".layer1").show();
                        window.location.href="login.html";
                    }


                }

    });
        // 趋势健康指标
        $.ajax({
        url: pageUrl+'/api/summary/gethealthindex',
        type: 'POST',
        dataType: 'json',
        data: {
            'startDate': startDate,
            'endDate': endDate,
            'storeNameCn': storeNameCn,
            'platform': platForm,
        },
        headers: {
            Authorization: 'Bearer '+cookie_value
        },
        success: function (data) {
            var msg = '';
            if (data) {
                if (data.code === 200) {
//                  客单件价
                    var keDJ = data.data.customerUnitPrice.customerUnitPrice;
                    var keDJ2 = data.data.customerUnitPrice.lastYearCustomerUnitPrice;
                    var qinshoulv = data.data.sellPercent;
                    // var keDanJia = data.data.customerPerItems.customerPerItems;
                    // var keDanJia2 = data.data.customerPerItems.lastYearCustomerPerItems;
                    var zheKou = data.data.offerPercent.offPercent;
                    var zheKou2 = data.data.offerPercent.lastYearOffPercent;
                    $(".module-04 .xuanxiang1 .kdjiaData0").html(keDJ);
                    $(".module-04 .xuanxiang1 .kdjiaData1").html(keDJ2);
                    $(".module-04 .xuanxiang1 .qinshoulv").html(qinshoulv);
                    // $(".module-04 .xuanxiang1 .kdjianData1").html(keDanJia2);
                    $(".module-04 .xuanxiang1 .zhekouData0").html(zheKou);
                    $(".module-04 .xuanxiang1 .zhekouData1").html(zheKou2);
                    $("#jt001").removeClass();

                    if (data.data.customerUnitPrice.trend==1){
                        $("#jt001").addClass("jt-top jiantou-icon");
                    } else if(data.data.customerUnitPrice.trend==2) {
                        $("#jt001").addClass("jt-down jiantou-icon");
                    }else if(data.data.customerUnitPrice.trend==0) {
                        $("#jt001").addClass("jt-top jiantou-icon");
                    };
                    $("#jt002").removeClass();
                   /* console.log(data.data.customerPerItems.trend);
                    if (data.data.customerPerItems.trend==1){
                        $("#jt002").addClass("jt-top jiantou-icon");
                        console.log(data.data.customerPerItems.trend+"99999999");
                    } else if(data.data.customerPerItems.trend==2) {
                        $("#jt002").addClass("jt-down jiantou-icon");
                    }else if(data.data.customerPerItems.trend==0) {
                        $("#jt002").addClass("jt-top jiantou-icon");
                    };*/
                     $("#jt003").removeClass();
                    if (data.data.offerPercent.trend==1){
                         $("#jt003").addClass("jt-top jiantou-icon");
                    } else if(data.data.offerPercent.trend==2) {
                         $("#jt003").addClass("jt-down jiantou-icon");
                    } else if(data.data.offerPercent.trend==0) {
                         $("#jt003").addClass("jt-top jiantou-icon");
                    };
                }
            }
        },
        error:  function (XMLHttpRequest, textStatus, errorThrown) {
                    // msg
                    var errorTips = XMLHttpRequest.responseJSON.msg;
                    console.log(XMLHttpRequest.responseJSON.code);
                    if (errorTips=='Division by zero'){
                        $(".layer1 .content").html("趋势健康指标数据错误");
                        $(".layer1").show();
                        console.log(errorTips);
                    } else if(errorTips=='Token has expired'){
                        $(".layer1 .content").html("令牌过期");
                        $(".layer1").show();
                        window.location.href="login.html";
                    }


                }

    });
        // 指标简报
        $.ajax({
        url: pageUrl+'/api/summary/getbriefreport',
        type: 'POST',
        dataType: 'json',
        data: {
            'startDate': startDate,
            'endDate': endDate,
            'storeNameCn': storeNameCn,
            'platform': platForm,
        },
        headers: {
            Authorization: 'Bearer '+cookie_value
        },
        success: function (data) {
            var msg = '';
            if (data) {
                if (data.code === 200) {
//                  客单件价
                    var baokeDJ = data.data.customerUnitPrice.customerUnitPrice;
                    var baokeDJ2 = data.data.customerUnitPrice.lastYearCustomerUnitPricePercent;
                    var baokeDJ3 = data.data.customerUnitPrice.lastCycleCustomerUnitPricePercent;
                    var baokeDanJia = data.data.customerPerItems.customerPerItems;
                    var baokeDanJia2 = data.data.customerPerItems.lastYearCustomerPerItemsPercent;
                    var baokeDanJia3 = data.data.customerPerItems.lastCycleCustomerPerItemsPercent;
                    var baozheKou = data.data.offerPercent.offPercent;
                    var baozheKou2 = data.data.offerPercent.lastYearOffPercent;
                    var baozheKou3 = data.data.offerPercent.lastCycleOffPercent;
                    console.log(baokeDJ+"---"+baokeDJ2+"---"+baokeDJ3+"---"+baokeDanJia+"---"+baokeDanJia2+"---"+baokeDanJia3+"---"+baozheKou+"---"+baozheKou2+"---"+baozheKou3)
                    $(".module-05 .zbjb11").html(baokeDJ);
               /*     $(".module-05 .zbjb13").html(baokeDJ2);
                    $(".module-05 .zbjb15").html(baokeDJ3);*/
                    $(".module-05 .zbjb21").html(baokeDanJia);
                  /*  $(".module-05 .zbjb23").html(baokeDanJia2);
                    $(".module-05 .zbjb25").html(baokeDanJia3);*/
                    $(".module-05 .zbjb31").html(baozheKou);
                  /*  $(".module-05 .zbjb33").html(baozheKou2);
                    $(".module-05 .zbjb35").html(baozheKou3);*/
                    /*if (baokeDJ2<0){
                        $(".module-05 .zbjb12").html("下跌");
                    }else {
                        $(".module-05 .zbjb12").html("上涨");
                    };
                    if (baokeDJ2<0){
                        $(".module-05 .zbjb14").html("下跌");
                    }else {
                        $(".module-05 .zbjb14").html("上涨");
                    };
                    if (baokeDJ2<0){
                        $(".module-05 .zbjb22").html("下跌");
                    }else {
                        $(".module-05 .zbjb22").html("上涨");
                    };
                    if (baokeDJ2<0){
                        $(".module-05 .zbjb24").html("下跌");
                    }else {
                        $(".module-05 .zbjb24").html("上涨");
                    };
                    if (baokeDJ2<0){
                        $(".module-05 .zbjb32").html("下跌");
                    }else {
                        $(".module-05 .zbjb32").html("上涨");
                    };
                    if (baokeDJ2<0){
                        $(".module-05 .zbjb34").html("下跌");
                    }else {
                        $(".module-05 .zbjb34").html("上涨");
                    };*/
                }
            }
        },
        error:  function (XMLHttpRequest, textStatus, errorThrown) {
                    // msg
                    var errorTips = XMLHttpRequest.responseJSON.msg;
                    if (errorTips=='Division by zero'){
                        $(".layer1 .content").html("指标简报数据错误");
                        $(".layer1").show();
                        console.log(errorTips);
                    } else if(errorTips=='Token has expired'){
                        $(".layer1 .content").html("令牌过期");
                        $(".layer1").show();
                        window.location.href="login.html";
                    }


                }

    });
        // 生意漏斗
        $.ajax({
        url: pageUrl+'/api/summary/getbusinessfunnel',
        type: 'POST',
        dataType: 'json',
        data: {
            'startDate': startDate,
            'endDate': endDate,
            'storeNameCn': storeNameCn,
            'platform': platformM,
        },
        headers: {
            Authorization: 'Bearer '+cookie_value
        },
        success: function (data) {
            var msg = '';
            if (data) {
                if (data.code === 200) {
//                  客单件价
                    var syld1 = data.data.businessFunnel.payRefund;
                    var syld2 = data.data.businessFunnel.deliveryRefund;
                    var syld3 = data.data.businessFunnel.gmv;
                    var syld4 = data.data.businessFunnel.deliveryAmount;
                    var syld5 = data.data.businessFunnel.deliveryPercent;
                    var syld6 = data.data.businessFunnel.deliveryPercent;
                    var syld7 = data.data.businessFunnel.inAccountAmountPercent;
                    var syld8 = data.data.businessFunnel.payAmount;
                    var syld9 = data.data.businessFunnel.payCusts;
                    var syld10 = data.data.businessFunnel.inAccountAmount;
                    var syld11 = data.data.businessFunnel.lastModifyDate;
                    var syld12 = data.data.businessFunnel.payPercent;
                    $(".yld-data .sy1").html(syld1);
                    $(".yld-data .sy2").html(syld2);
                    $(".yld-data .sy3").html(syld3);
                    $(".yld-data .sy4").html(syld8);
                    $(".yld-data .sy5").html(syld9);
                    $(".yld-data .sy6").html(syld4);
                    $(".yld-data .sy7").html(syld10);
                    $(".yld-data .sy8").html(syld11);
                    $(".yld-data .sy11").html(syld7+"%");
                    $(".yld-data .sy12").html(syld6+"%");
                    $(".yld-data .sy13").html(syld12+"%");
                }
            }
        },
        error:  function (XMLHttpRequest, textStatus, errorThrown) {
                    // msg
                    var errorTips = XMLHttpRequest.responseJSON.msg;
                    if (errorTips=='Division by zero'){
                        $(".layer1 .content").html("生意漏斗数据错误");
                        $(".layer1").show();
                        console.log(errorTips);
                    } else if(errorTips=='Token has expired'){
                        $(".layer1 .content").html("令牌过期");
                        $(".layer1").show();
                        window.location.href="login.html";
                    }


                }

    });
        // 目标数据
        $.ajax({
        url: pageUrl+'/api/summary/getgoaldata',
        type: 'POST',
        dataType: 'json',
        headers: {
            Authorization: 'Bearer '+cookie_value
        },
        success: function (data) {
            var msg = '';
            if (data) {
                if (data.code === 200) {
                    var mubiaoVal = data.data;
                    $(".module-02 .module-02-data li").remove()
                    var mubiaoValF = $(".module-02 .module-02-data");
                    /*for in 循环*/
                    for(var i in mubiaoVal){
                        var text="<li>" + "<p>" + i + " </p>"+"<span>" + mubiaoVal[i] + " </span>" + "</li>";
                        mubiaoValF.append(text);
                    };
                }
            }
        },
        error:  function (XMLHttpRequest, textStatus, errorThrown) {
                    // msg
                    var errorTips = XMLHttpRequest.responseJSON.msg;
                    if (errorTips=='Division by zero'){
                        $(".layer1 .content").html("目标数据数据错误");
                        $(".layer1").show();
                        console.log(errorTips);
                    } else if(errorTips=='Token has expired'){
                        $(".layer1 .content").html("令牌过期");
                        $(".layer1").show();
                        window.location.href="login.html";
                    }


                }

    });


        // 图表
        $.ajax({
        url: pageUrl+'/api/common/getaccesstoken',
        type: 'POST',
        dataType: 'json',
        success: function (data) {
            var msg = '';
            if (data) {
                var accessToken = data.data.accessToken.value;
                var myUrl = "https://app.powerbi.cn/reportEmbed?reportId=c8c37954-e86b-4be2-8d7a-a824c8392a92&groupId=13e42e94-3404-46d8-b605-228c35984df3";
                if (platForm =="ALL" && storeName !== "ALL"){
                     var myUrl = myUrl+"&filter=date_table/data_date ge"+" "+startDate+" "+"and date_table/data_date le"+" "+endDate+" "+"and platform_table/platform eq"+" '"+storeName+"'";
                     GMV(accessToken,myUrl);
                     UV(accessToken,myUrl);
                     MUB(accessToken,myUrl);
                     KDJian(accessToken,myUrl);
                     QSL(accessToken,myUrl);
                     ZheKou(accessToken,myUrl);
                     fangkeshu(accessToken,myUrl);
                     zhifujine(accessToken);
                } else if(storeName == "ALL" && platForm !=="ALL"){
                    var myUrl = myUrl+"&filter=date_table/data_date ge"+" "+startDate+" "+"and date_table/data_date le"+" "+endDate+" "+"and platform_table/platform eq"+" '"+platForm+"'";
                    GMV(accessToken,myUrl);
                     UV(accessToken,myUrl);
                     MUB(accessToken,myUrl);
                     KDJian(accessToken,myUrl);
                     QSL(accessToken,myUrl);
                     ZheKou(accessToken,myUrl);
                     fangkeshu(accessToken,myUrl);
                     zhifujine(accessToken);
                } else if (storeName == "ALL" && platForm =="ALL"){
                    var myUrl = myUrl+"&filter=date_table/data_date ge"+" "+startDate+" "+"and date_table/data_date le"+" "+endDate;
                    GMV(accessToken,myUrl);
                     UV(accessToken,myUrl);
                     MUB(accessToken,myUrl);
                     KDJian(accessToken,myUrl);
                     QSL(accessToken,myUrl);
                     ZheKou(accessToken,myUrl);
                     fangkeshu(accessToken,myUrl);
                     zhifujine(accessToken);
                } else {
                    var myUrl = myUrl+"&filter=date_table/data_date ge"+" "+startDate+" "+"and date_table/data_date le"+" "+endDate+" "+"and platform_table/platform eq"+" '"+platForm+"' "+"and shop_table/shop eq"+" '"+storeName+"'";
                    GMV(accessToken,myUrl);
                     UV(accessToken,myUrl);
                     MUB(accessToken,myUrl);
                     KDJian(accessToken,myUrl);
                     QSL(accessToken,myUrl);
                     ZheKou(accessToken,myUrl);
                     fangkeshu(accessToken,myUrl);
                     zhifujine(accessToken);
                }

            }
        },
        error:  function (XMLHttpRequest, textStatus, errorThrown) {
                    // msg
                    var errorTips = XMLHttpRequest.responseJSON.msg;
                    if (errorTips=='Division by zero'){
                        $(".layer1 .content").html("数据错误");
                        $(".layer1").show();
                        console.log(errorTips);
                    } else if(errorTips=='Token has expired'){
                        $(".layer1 .content").html("令牌过期");
                        $(".layer1").show();
                        window.location.href="login.html";
                    }


                }

    });

    });

    // tips弹框
    $(".module-01 .gantan").on("click",function () {
        $(".fixed").show();
        $(".fixedmain").show();
        $(".main-con").html("");
        $(".main-con").html("生意主要指标：关注店铺支付金额及UV环比表现，快速评估店铺整体表现。");
    });
    $(".module-02 .gantan").on("click",function () {
        $(".fixed").show();
        $(".fixedmain").show();
        $(".main-con").html("目标：展示选定周期内完成情况；结合年度完成度及时间流失率，及时修正下一阶段营销目标。");
    });
    $(".module-03 .gantan").on("click",function () {
        $(".fixed").show();
        $(".fixedmain").show();
        $(".main-con").html("品牌相关用户指标：关注品牌用户的增长速度，保证品牌用户数；监控新老用户比重。");
    });
    $(".module-04 .gantan").on("click",function () {
        $(".fixed").show();
        $(".fixedmain").show();
        $(".main-con").html("趋势健康指标：关注店铺细分维度表现，通过环比表现挖掘导致当前表现较好（或较差）的因素。");
    });
    $(".module-05 .gantan").on("click",function () {
        $(".fixed").show();
        $(".fixedmain").show();
        $(".main-con").html("生意漏斗：关注订单流转过程中各环节转化效果。对比两次退款行为的比重，有针对提高支付转化和降低售后退款。");
    });
    $(".module-06 .gantan").on("click",function () {
        $(".fixed").show();
        $(".fixedmain").show();
        $(".main-con").html("指标简报：展示各渠道（天猫与京东？）销售对比，调整各渠道销售战略。 ");
    });
    $('.close_re').click(function(){
        $('.fixed').hide()
        $('.fixedmain').hide()
    });
});



